package com.hui.stock.job;

import com.hui.stock.service.StockTimerTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author: ymh
 * @date: 2024/12/18 15:15
 * @description: 定义股票相关数据的定时任务
 */
@Component
public class StockJob {

    @Autowired
    private StockTimerTaskService stockTimerTaskService;

    @XxlJob("hui_job_test")
    public void jobTest(){
        System.out.println("jobTest run.....");
    }

    /**
     * 定义定时任务，采集国内大盘数据
     */
    @XxlJob("getStockInnerMarketInfos")
    public void getStockInnerMarketInfos(){
        stockTimerTaskService.getInnerMarketInfo();
    }

    /**
     * 定义定时任务，采集国内个股数据
     */
    @XxlJob("getStockRtIndexInfos")
    public void getStockRtIndexInfos(){
        stockTimerTaskService.getStockRtIndex();
    }

    /**
     * 定义定时任务，采集板块数据
     */
    @XxlJob("getStockBlockInfos")
    public void getStockBlockInfos(){
        stockTimerTaskService.getStockBlockInfo();
    }
}
